<template>
	<view class="common-item animated fadeInRight">
		<view class="common-item-l">
			<image :src="items.userpic" mode="widthFix"></image>
		</view>
		<view class="common-item-r">
			<view class="item-r-header">
				<view class="header-l">
					<view class="name">{{items.username}}</view>
					<view class="sex">
						<view class="sex-s">
							{{items.sex=='0'?'♂':'♀'}}
						</view>
						<view class="age">
							{{items.age}}
						</view>
					</view>
				</view>
				<view class="header-r">
					<view class="follow" :class="{active:isguanzhu}" @tap='followTap'>
						<view v-if="!isguanzhu" class="iconfont iconjia"></view><view>
							{{isguanzhu?'已关注':'关注'}}
						</view>
					</view>
					<view class="clos iconfont iconguanbi" @tap="exit"></view>
				</view>
			</view>
			<view class="item-r-conten">
				<view class="conten-info">
					{{items.title}}
				</view>
				<view class="conten-img">
					<!-- 视频 -->
					<template v-if="items.video">
						<view class="video-form">
							<view class="pay iconfont iconbofang"></view>
							<view class="pay_info">
								{{items.video.looknum+' 次播放 '+items.video.long}}
							</view>
						</view>
						<image :src="items.titlepic" mode="widthFix"></image>
					</template>
					<template v-else-if="items.titlepic">
						<image :src="items.titlepic" mode="widthFix"></image>
					</template>
					<!--图片-->
					<template v-else-if="items.share">
						<view class="forward">
							<image :src="items.share.titlepic" mode="widthFix"></image>
							<view class="forward_title">
								{{items.share.title}}
							</view>
						</view>
					</template>
				</view>
			</view>
			<view class="item-r-footer">
				<view class="address">
					{{items.path}}
				</view>
				<view class="footer-icon">
					<view class="forward"><view class="iconfont iconzhuanfa"></view>{{items.sharenum}}</view>
					<view class="comment"><view class="iconfont iconpinglun"></view>{{items.commentnum}}</view>
					<view class="zan"><view class="iconfont icondianzan"></view>{{items.goodnum}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isguanzhu: this.items.isguanzhu
			};
		},
		props:{
			items:{
				type:Object
			},
			index:{
				type:Number
			}
		},
		methods:{
			followTap(){
				this.isguanzhu= !this.isguanzhu
			}
		}
	}
</script>

<style>
.common-item {
		position: relative;
		width: 100%;
		display: flex;
		padding: 50rpx 0 0 0;
	}

	.common-item .common-item-l {
		flex: 0 0 auto;
		margin-right: 14rpx;
	}

	.common-item>.common-item-l image {
		width: 90rpx;
		height: 90rpx;
		border-radius: 50%;
	}

	.common-item>.common-item-r {
		display: flex;
		flex-direction: column;
		flex:  1 1 auto;
		overflow: hidden;
		border-bottom: 1rpx solid #eaeaea;
	}
	.common-item:last-child>.common-item-r{
		border: none;
	} 
	.common-item>.common-item-r .item-r-header {
		display: flex;
		flex: 0 0 auto;
		justify-content: space-between;
		align-items: center;
	}

	.common-item>.common-item-r .item-r-header .header-l,.header-r,.header-r >view{
		display: flex;
		font-size: 28rpx;
		color: #999;
		justify-content: center;
		align-items: center;
	}

	.header-l .name {
		font-size: 28rpx;
		margin-right: 12rpx;
	}

	.header-l .sex {
		display: flex;
		justify-content: center;
		align-items: center;
		border-radius: 20rpx;
		background: #44b3ff;
		font-size: 12rpx;
		color: #fff;
		padding: 2rpx 14rpx;
		box-sizing: border-box;
	}
	.header-l .sex view{
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.header-r .follow{
		width: 95rpx;
		height: 40rpx;
		margin-right: 18rpx;
		background: #f4f4f4;
		font-size: 22rpx;
		color: #000;
	}
	.header-r .follow.active{
		background: #FF9619;
		color: #fff;
	}
	.header-r .follow .iconfont{
		font-size: 22rpx;
	}
	.header-r .clos {
		font-weight: bold;
		color: #d3d3d3;
	}
	
	.common-item>.common-item-r .item-r-conten {
		font-size: 32rpx;
		margin-top: 10rpx;
	}
	.item-r-conten .conten-info{
		margin-bottom: 10rpx;
		line-height: 54rpx;
	}
	.item-r-conten  .conten-img{
		width: 100%;
		/* line-height: 0; */
		font-size: 0;
		position: relative;
	}
	.item-r-conten  .conten-img .video-form{
		position: absolute;
		top: 0;
		left: 0;
		bottom: 0;
		right: 0;
		z-index: 10;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.video-form .pay{
		font-size: 155rpx;
		color: #fff;
	}
	.video-form .pay_info{
		position: absolute;
		bottom: 10rpx;
		right: 10rpx;
		font-size: 20rpx;
		padding: 10rpx 20rpx;
		border-radius: 40rpx;
		color: #fff;
		background: rgba(0,0,0,0.5);
	}
	.item-r-conten  .conten-img image{
		width: 100%;
		border-radius: 10rpx;
	}
	.item-r-conten  .conten-img .forward{
		display: flex;
		align-items: center;
		width: 100%;
		height: 110rpx;
		overflow: hidden;
		background: #f7f7f7;
		
		box-sizing: border-box;
		border-radius: 10rpx; 
	}
	.item-r-conten  .conten-img .forward >image{
		flex: 0 0 125rpx;
		margin: 0 30rpx 0 5rpx;
	}
	.item-r-conten  .conten-img .forward > .forward_title{
		flex: 1 1 auto;
		font-size: 26rpx;
		line-height: 42rpx;
		padding: 15rpx 5rpx 18rpx 0;
	}
	.common-item>.common-item-r .item-r-footer{
		display: flex;
		justify-content: space-between;
		font-size: 24rpx;
		color: #bababa;
		padding:25rpx 0 20rpx 0;
		
	}
	.common-item>.common-item-r .footer-icon{
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.common-item>.common-item-r .footer-icon> view{
		display: flex;
		flex: 0 0 auto;
		margin-right: 15rpx;
		justify-content: center;
		align-items: center;
	}
	.common-item>.common-item-r .footer-icon> view .iconfont{
		margin-right: 10rpx;
	}
</style>
